<?php

declare(strict_types=1);
/**
 * This file is part of habo_new_media.
 *
 * @link     https://www.berlen.cn/
 * @contact  tech@berlen.cn
 * @license  http://gitlab.rehou.cn/habo/habo_new_media/-/blob/master/README.md
 */
namespace app\service\cost\flow;

use app\enum\ServiceCostEnum;
use app\model\TaskAccountModel;
use app\service\cost\CostService;
use app\service\cost\PullService;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;

class VideoService extends CostService implements FlowInterface
{
    /**
     * @var int 操作类型
     */
    protected int $taskAccountType = ServiceCostEnum::TASK_TYPE_VIDEO;

    /**
     * @var int|mixed
     */
    protected ?PullService $pullService;

    /**
     * 获取媒体数据.
     * @param TaskAccountModel $model 任务模型
     * @return bool
     */
    protected function getCostData(TaskAccountModel $model): bool
    {
        if (! $this->pullService->getMaterialDailyReport($model)) {
            return false;
        }
        return true;
    }
}
